﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Noebe
{
    public interface IEntitySession
    {
        /// <summary>
        /// insert
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        int Insert(params IEntityBase[] entities);

        /// <summary>
        /// insert without primarykey
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        int AutoInsert(params IEntityBase[] entities);

        /// <summary>
        /// update
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        int Update(params IEntityBase[] entities);

        /// <summary>
        /// delete
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        int Delete(params IEntityBase[] entities);

        /// <summary>
        /// 根据外键级联删除
        /// </summary>
        /// <param name="table"></param>
        void CascadeDelete(params IEntityBase[] entities);
    }
}
